package com.bg2009.ancienttech;

import net.minecraft.world.item.BlockItem;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.neoforged.neoforge.registries.DeferredBlock;
import net.neoforged.neoforge.registries.DeferredItem;
import net.neoforged.neoforge.registries.DeferredRegister;

public class BlockReg {
    // Create a Deferred Register to hold Blocks which will all be registered under the "ancienttech" namespace
    public static final DeferredRegister.Blocks BLOCKS = DeferredRegister.createBlocks(AncientTechMain.MODID);

    // Creates a new Block with the id "examplemod:ancient_grass", combining the namespace and path
    //public static final DeferredBlock<Block> EXAMPLE_BLOCK = BLOCKS.registerSimpleBlock("example_block", BlockBehaviour.Properties.of().mapColor(MapColor.STONE));
    public static final DeferredBlock<Block> ANCIENT_GRASS = BLOCKS.registerSimpleBlock(
            "ancient_grass",
            BlockBehaviour.Properties.of()
                    .destroyTime(1.0F)
                    .sound(SoundType.GRASS)
                    .explosionResistance(1.0F)
                    .lightLevel(state -> 2) //设置光照等级用法 一种lambda表达式实现转换的方法
    );

    public static final DeferredBlock<Block> ANCIENT_DIRT = BLOCKS.registerSimpleBlock(
            "antient_dirt",
            BlockBehaviour.Properties.of()
                    .destroyTime(0.5F)
                    .sound(SoundType.ROOTED_DIRT)
                    .explosionResistance(0.5F)
                    .lightLevel(state -> 0)
    );

    public static final DeferredBlock<Block> ANCIENT_FRUIT_BOTTOM = BLOCKS.registerSimpleBlock(
            "ancient_fruit_bottom",
            BlockBehaviour.Properties.of()
                    .sound(SoundType.WET_GRASS)
                    .destroyTime(0.1F)
                    .explosionResistance(0.1F)
    );

    public static final DeferredBlock<Block> ANCIENT_FRUIT_TOP = BLOCKS.registerSimpleBlock(
            "ancient_fruit_top",
            BlockBehaviour.Properties.of()
                    .sound(SoundType.WET_GRASS)
                    .destroyTime(0.1F)
                    .explosionResistance(0.1F)
    );

    public static final DeferredBlock<Block> ANCIENT_BROKEN_CHEST = BLOCKS.registerSimpleBlock(
            "ancient_broken_chest",
            BlockBehaviour.Properties.of()
                    .destroyTime(2.0f)
                    .sound(SoundType.BAMBOO_WOOD)
                    .explosionResistance(1.0F)
    );


}
